﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace IAD2
{
    class CirclePoints : PointGenerator
    {
        public CirclePoints(Neuron center, double radius, int number)
        {
            this.points = new List<Neuron>();
            Random random = new Random();
            for (int i = 0; i < number; i++)
            {
                Neuron randPoint;
                do {
                    double x = (random.NextDouble() * 2 - 1) * radius + center.X;
                    double y = (random.NextDouble() * 2 - 1) * radius + center.Y;
                    randPoint = new Neuron(x, y);
                } while (Math.Sqrt(Math.Pow((randPoint.X - center.X), 2) + Math.Pow( (randPoint.Y - center.Y), 2)) > radius);
                 this.points.Add(randPoint);
            }
        }
    }
}
